// house_pkg/pages/building/index.ts
Page({
  data: {
    point: '',
    size: 0,
    type: ''
  },
  onLoad(params) {
    // console.log(params)
    // encodeURIComponent 编码
    this.fake(decodeURIComponent(params.point))
  },
  fake(point) {
    // point => 小区信息
    // 随机楼栋信息
    // 楼栋的数量
    const size = wx.utils.getRandomIntInclusive(3, 6)
    // 文案，模拟的真实一些
    const type = size > 4 ? '号楼' : '栋'

    this.setData({
      point,
      size,
      type
    })
  },
  goRoom(ev) {
    wx.navigateTo({
      url: `/house_pkg/pages/room/index?point=${this.data.point}&building=${ev.mark.building}`,
    })
  }
})